<template>

<div>
	<el-container>
	  <el-header>Header</el-header>
	  <el-container>
		<el-aside width="200px">
			<el-row class="tac">
			  <el-col >
		
			    <el-menu router unique-opened>
			      <el-submenu :index="index+''" v-for="(item,index) in this.$router.options.routes " :key="index" v-if = "!item.hidden">
			        <template slot="title">
			          <i class="el-icon-location"></i>
			          <span>{{item.name}}</span>
			        </template>
			          <el-menu-item :index="children.path+ ''" v-for="(children,indexj) in item.children">
					  {{children.path}}
					  </el-menu-item>
			          <!-- <el-menu-item index="/test2">商城属性</el-menu-item> -->

			      </el-submenu>

			    </el-menu>
			  </el-col>

			</el-row>
		</el-aside>
		<el-main>
			<router-view></router-view>
		</el-main>
	  </el-container>
	</el-container>
</div>
</template>

  <script>
	import indexApi from '../api/index.js'
    export default {
		data() {
		  return {
			// imgurl1:"",

		  }
		},
		created () {
			// sessionStorage.clear()
// store.commit('increment')
			const paths = this.$router.options.routes[1]['children']
			console.log(paths) 
			let self = this
			indexApi.index().then((res) => {
				// 	const userinfo = sessionStorage.getItem("userinfo");
					// console.log(res)
					// console.log(1111)
				// console.log(userinfo)
			}).catch((error) => {
				  //接口调用方法统一处理
				  // this.logining = false;
				// this.updateImg()
			});	
		
		},
		methods:{
			menuClick(index){
				this.$router.push(index)
			}
		}
	}
  </script>

<style>
  /* .el-header, .el-footer {
    background-color: #B3C0D1;
    color: #333;
    text-align: center;
    line-height: 60px;
  }
  
  .el-aside {
    background-color: #D3DCE6;
    color: #333;
    text-align: center;
    line-height: 200px;
  }
  
  .el-main {
    background-color: #E9EEF3;
    color: #333;
    text-align: center;
    line-height: 160px;
  }
  
  body > .el-container {
    margin-bottom: 40px;
  }
  
  .el-container:nth-child(5) .el-aside,
  .el-container:nth-child(6) .el-aside {
    line-height: 260px;
  }
  
  .el-container:nth-child(7) .el-aside {
    line-height: 320px;
  } */
</style>
